package com.fr.chart.plot;

import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.chart.base.equals.Equals;
import com.fr.chart.core.glyph.MeterPlotGlyph;
import com.fr.chart.core.glyph.PlotGlyph;
import com.fr.chart.legend.LegendItem;
import com.fr.data.ChartData;

public class MeterPlot extends Plot
{
  private static final long serialVersionUID = 1L;
  private MeterStyle meterStyle = new MeterStyle();

  public MeterPlot()
  {
    setLegend(null);
  }

  public LegendItem[] createLegendItems(PlotGlyph paramPlotGlyph)
  {
    return new LegendItem[0];
  }

  public void setMeterStyle(MeterStyle paramMeterStyle)
  {
    this.meterStyle = paramMeterStyle;
  }

  public MeterStyle getMeterStyle()
  {
    return this.meterStyle;
  }

  public PlotGlyph createPlotGlyph(ChartData paramChartData)
  {
    MeterPlotGlyph localMeterPlotGlyph = new MeterPlotGlyph();
    install4PlotGlyph(localMeterPlotGlyph, paramChartData);
    createAxisGlyph(localMeterPlotGlyph);
    return localMeterPlotGlyph;
  }

  public void install4PlotGlyph(MeterPlotGlyph paramMeterPlotGlyph, ChartData paramChartData)
  {
    super.install4PlotGlyph(paramMeterPlotGlyph, paramChartData);
    paramMeterPlotGlyph.setMeterStyle(this.meterStyle);
  }

  public void createAxisGlyph(PlotGlyph paramPlotGlyph)
  {
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("Plot");
    super.writeXML(paramXMLPrintWriter);
    if (this.meterStyle != null)
      this.meterStyle.writeXML(paramXMLPrintWriter);
    paramXMLPrintWriter.end();
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    super.readXML(paramXMLableReader);
    if (paramXMLableReader.isChildNode())
    {
      String str = paramXMLableReader.getTagName();
      if ("MeterStyle".equals(str))
        this.meterStyle = ((MeterStyle)paramXMLableReader.readXMLObject(new MeterStyle()));
    }
  }

  public boolean equals(Object paramObject)
  {
    if (!(paramObject instanceof MeterPlot))
      return false;
    MeterPlot localMeterPlot = (MeterPlot)paramObject;
    if (!(super.equals(localMeterPlot)))
      return false;
    return (Equals.equals(localMeterPlot.getMeterStyle(), getMeterStyle()));
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    MeterPlot localMeterPlot = (MeterPlot)super.clone();
    if (this.meterStyle != null)
      localMeterPlot.setMeterStyle((MeterStyle)this.meterStyle.clone());
    return localMeterPlot;
  }
}